//
//  BaseNetworkRequest+FoodCategoryDetails.m
//  ShiWuPai
//
//  Created by app on 16/11/30.
//  Copyright © 2016年 QQ:244987427. All rights reserved.
//

#import "BaseNetworkRequest+FoodCategoryDetails.h"
#import "WHFoodDetailsList.h"
#import <YYModel.h>

NSString *const kFoodDetailsListPath=@"foods";
#define NumberToString(Number) [NSString stringWithFormat:@"%@",@(Number)]
@implementation BaseNetworkRequest (FoodCategoryDetails)
+(void)getFoodDetailsListWithOrderAsc:(NSInteger)orderAsc Page:(NSInteger)page Value:(NSInteger)value Kind:(NSString *)kind OrderBy:(NSInteger)orderBy success:(void(^)(id responseObj,NSError *error))completionHandler{
    
    NSDictionary *ParameterDic=@{
                                 @"order_asc":NumberToString(orderAsc),
                                 @"page":NumberToString(page),
                                 @"value":NumberToString(value),
                                 @"kind":kind,
                                 @"order_by":NumberToString(orderBy)
                                 };
    [self rquestWithType:@"GET" Path:kFoodDetailsListPath Parameters:ParameterDic success:^(id responseObj, NSError *error) {
        if (!error) {
            WHFoodDetailsList *foodDetailsList=[WHFoodDetailsList yy_modelWithJSON:responseObj];
            completionHandler(foodDetailsList,nil);
        }
        else{
            completionHandler(nil,error);
        }
    }];
}
@end
